package com.project.code.base;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class BaseEntity {
    /**
     * 3id
     * */
    public Long id;
    /**
     * 更新时间
     * */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date updateDate;
    /**
     * 创建时间
     * */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date createDate;

    public void preInsert(){
        this.updateDate = new Date();
        this.createDate = new Date();
    }


}
